package org.familysearch.fsapi.gwt.services.client;

import org.familysearch.fsapi.gwt.common.client.entities.Temple;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.rpc.ServiceDefTarget;

public class TempleServiceProxy {

    private static TempleServiceProxy instance;
    private TempleServiceAsync proxy;

    private TempleServiceProxy()
    {
        proxy = (TempleServiceAsync) GWT
                .create(TempleService.class);
        ((ServiceDefTarget) proxy).setServiceEntryPoint(GWT.getModuleBaseURL()
                + "TempleService");
    }

    public static TempleServiceProxy get()
    {
        if (instance == null) {
            instance = new TempleServiceProxy();
        }
        return instance;
    }
    
    public void getTemples(AsyncCallback callback) 
    {
    	proxy.getTemples(callback);
    }

	public void getTemple(Temple temple, AsyncCallback callback) {
		proxy.getTemple(temple, callback);
	}
}
